import request from '@/utils/request'

export const getQuestionList = params =>
  request({
    url: 'admin/exam/question',
    params,
  })

export const getSubjectMenu = () =>
  request({
    url: 'admin/subject/tree',
  })

export const addQuestion = data =>
  request({
    url: 'admin/exam/question',
    method: 'post',
    data,
  })

export const getQuestionDetail = id =>
  request({
    url: `admin/exam/question/${id}`,
  })

export const updateQuestion = data =>
  request({
    url: `admin/exam/question/${data.id}`,
    method: 'put',
    data,
  })

export const auditQuestion = data =>
  request({
    url: '/admin/exam/question/check',
    method: 'post',
    data,
  })

export const deleteQuestion = id =>
  request({
    url: `admin/exam/question/${id}`,
    method: 'delete',
  })

export const editQuestionShow = data =>
  request({
    url: '/admin/exam/question/show',
    method: 'post',
    data,
  })
